﻿@using Castle.Core.Internal
@model music.web.Models.Home.InfoModel
@{
	ViewBag.Title = Model.Song.FullTitle;
	Layout = "~/Views/Shared/_Layout.cshtml";
}
<div class="page-block">
	<div class="page-header">
		<h2>@Model.Song.Title <small>@Model.Song.Artist</small></h2>
	</div>
	@if (Model.Song.HasDescription)
 {
		<p>
			@Html.Raw(Model.Song.DisplayDescription)
		</p>
 }
	@Html.Partial("Player", Model.Song)
	<ul class="song-info">
		<li class="user-login">@Model.Song.DisplayUserLogin</li>
		<li class="created">@Model.Song.DisplayCreated</li>
		<li class="download-count">@Model.Song.DisplayDownloadCount</li>
		@Html.Partial("RateButtons", Model.Song)
	</ul>
</div>
@if (!Model.Comments.IsNullOrEmpty())
{
	<div class="page-block">
		<div class="page-header">
			<h3>
				Комментарии</h3>
		</div>
		@foreach (var comment in Model.Comments)
  {
			<div class="comment-container">
				<div class="comment-photo">
					<img src="@comment.UserPhotoUrl" alt="photo"/>
				</div>
				<div class="comment-data">
					<p>
						@Html.Raw(comment.DisplayText)
					</p>
					<p>
						<small>@comment.Info</small>
					</p>
				</div>
			</div>
  }
	</div>
}
<div class="page-block">
	@using (Html.BeginForm("AddComments", "Home", FormMethod.Post, new { @class = "form-comments" }))
 {
		<fieldset>
			<legend>Оставить комментарий</legend>
			@Html.Hidden("songId", Model.Song.Id)
			@Html.TextArea("text", new { @class = "new-comment-text" })
			<div>
				<button class="btn" type="submit">
					Готово!</button>
			</div>
		</fieldset>
 }
</div>
